<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template attribute_value_impl</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Log v2">
<link rel="up" href="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_hpp" title="Header &lt;boost/log/attributes/attribute_value_impl.hpp&gt;">
<link rel="prev" href="../swap_idm45961921953952.html" title="Function swap">
<link rel="next" href="make_attribute_value.html" title="Function template make_attribute_value">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../swap_idm45961921953952.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="make_attribute_value.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.attributes.attribute_value_impl"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template attribute_value_impl</span></h2>
<p>boost::log::attributes::attribute_value_impl — Basic attribute value implementation class. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_hpp" title="Header &lt;boost/log/attributes/attribute_value_impl.hpp&gt;">boost/log/attributes/attribute_value_impl.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="attribute_value_impl.html" title="Class template attribute_value_impl">attribute_value_impl</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">attribute_value</span><span class="special">::</span><span class="identifier">impl</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">T</span> <a name="boost.log.attributes.attribute_value_impl.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>  <span class="comment">// Value type. </span>

  <span class="comment">// <a class="link" href="attribute_value_impl.html#boost.log.attributes.attribute_value_implconstruct-copy-destruct">construct/copy/destruct</a></span>
  <span class="keyword">explicit</span> <a class="link" href="attribute_value_impl.html#idm45961921933344-bb"><span class="identifier">attribute_value_impl</span></a><span class="special">(</span><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="attribute_value_impl.html#idm45961921931648-bb"><span class="identifier">attribute_value_impl</span></a><span class="special">(</span><span class="identifier">value_type</span> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_nothrow_move_constructible</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="attribute_value_impl.html#idm45961921942896-bb">public member functions</a></span>
  <span class="keyword">virtual</span> <span class="keyword">bool</span> <a class="link" href="attribute_value_impl.html#idm45961921942336-bb"><span class="identifier">dispatch</span></a><span class="special">(</span><span class="identifier">type_dispatcher</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">typeindex</span><span class="special">::</span><span class="identifier">type_index</span> <a class="link" href="attribute_value_impl.html#idm45961921938032-bb"><span class="identifier">get_type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">value_type</span> <span class="keyword">const</span>  <span class="special">&amp;</span> <a class="link" href="attribute_value_impl.html#idm45961921935632-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm46846478110832"></a><h2>Description</h2>
<p>This class can be used as a boilerplate for simple attribute values. The class implements all needed interfaces of attribute values and allows to store a single value of the type specified as a template parameter. The stored value can be dispatched with type dispatching mechanism. </p>
<div class="refsect2">
<a name="idm46846478109856"></a><h3>
<a name="boost.log.attributes.attribute_value_implconstruct-copy-destruct"></a><code class="computeroutput">attribute_value_impl</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45961921933344-bb"></a><span class="identifier">attribute_value_impl</span><span class="special">(</span><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> v<span class="special">)</span><span class="special">;</span></pre>
<p>Constructor with initialization of the stored value </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45961921931648-bb"></a><span class="identifier">attribute_value_impl</span><span class="special">(</span><span class="identifier">value_type</span> <span class="special">&amp;&amp;</span> v<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_nothrow_move_constructible</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>
<p>Constructor with initialization of the stored value </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm46846478087952"></a><h3>
<a name="idm45961921942896-bb"></a><code class="computeroutput">attribute_value_impl</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">bool</span> <a name="idm45961921942336-bb"></a><span class="identifier">dispatch</span><span class="special">(</span><span class="identifier">type_dispatcher</span> <span class="special">&amp;</span> dispatcher<span class="special">)</span><span class="special">;</span></pre>
<p>Attribute value dispatching method.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">dispatcher</code></span></p></td>
<td><p>The dispatcher that receives the stored value</p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p><code class="computeroutput">true</code> if the value has been dispatched, <code class="computeroutput">false</code> otherwise </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">typeindex</span><span class="special">::</span><span class="identifier">type_index</span> <a name="idm45961921938032-bb"></a><span class="identifier">get_type</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The attribute value type </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <span class="keyword">const</span>  <span class="special">&amp;</span> <a name="idm45961921935632-bb"></a><span class="identifier">get</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>Reference to the contained value. </p></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2007-2021 Andrey Semashev<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../swap_idm45961921953952.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="make_attribute_value.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
